<template>
  <page-body>
    <view class="page">
      <!---flex布局flex布局开始-->
      <view class="flex flex-wrap align-start benben-flex-layout review_flex_0">
        <view class='flex flex-wrap align-center review_fd0_0'
          style="display: flex;justify-content: space-between;align-items: center;">
          <view class='flex flex-wrap align-center'>
            <text class='fu-iconfont2  review_fd0_0_c0_c0' @tap.stop="handleJumpDiy" data-type="back"
              data-url="1">&#xe794;</text>
          </view>
          <view class='flex flex-wrap align-center'>
            <!-- <text class='fu-iconfont2  review_fd0_0_c0_c0' @tap.stop="handleJumpDiy" data-type="back"
              data-url="1">&#xe794;</text> -->
          </view>
          <view class='flex flex-wrap align-center' @tap.stop="setpost66d1657cc97a9">
            <text class='fu-iconfont2  review_fd0_0_c0_c0' style="font-size: 28rpx;color: #666;">清空</text>
          </view>
        </view>
      </view>

      <!---flex布局flex布局结束-->
      <!---flex布局flex布局开始-->
      <view class="flex flex-direction flex-wrap align-stretch benben-flex-layout review_flex_1">
        <view class='flex flex-wrap align-center justify-between review_fd1_0'>
          <view class='flex flex-direction flex-wrap align-stretch' @tap.stop="changeStaed(0,list.wrong_total)">
            <text class='review_fd1_0_c0_c0'>{{list.wrong_total}}</text>
            <text class='review_fd1_0_c0_c1'>错题总数</text>
          </view>
          <view class='flex flex-direction flex-wrap align-stretch' @tap.stop="changeStaed(1,list.today_wrong)">
            <text class='review_fd1_0_c0_c0'>{{list.today_wrong}}</text>
            <text class='review_fd1_0_c0_c1'>今日错题</text>
          </view>
          <view class='flex flex-direction flex-wrap align-stretch'>
            <view class='flex flex-wrap align-center justify-center'>
              <text class='review_fd1_0_c0_c0'>{{list.radio?list.radio:0}}</text>
              <text class='review_fd1_0_c2_c0_c1'>%</text>
            </view>
            <text class='review_fd1_0_c0_c1'>错题/已做题</text>
          </view>
        </view>
      </view>

      <!---flex布局flex布局结束-->
      <!---flex布局flex布局开始-->
      <view class="flex benben-flex-layout flex-wrap align-center review_flex_2">
        <view class='flex flex-direction align-stretch review_fd2_0'>
          <view class='flex flex-wrap align-center justify-between review_fd2_0_c0'>
            <text>答对自动移出错题</text>
            <!-- <benben-switch v-model="Onswitch" default-color='#dcdfe6' color='#46BB36' :disabled='false' :auto='true'
              size='80'>
            </benben-switch> -->
          </view>
          <view class='flex flex-wrap align-center justify-between'>
            <benben-select-diy ref="showSelectPopup1724747835146"
              class-name='flex align-stretch justify-between flex review_fd2_0_c1_c0' :items.sync="deletes"
              v-model="deletVeal" :label.sync="deleteLab" default-type="value" default-label="name"
              :allow-cancel='false' type="radio" :disabled='false' @change="TabsChange">
              <template v-for='(item,key0) in deletes'>
                <view v-if="item.isSelected" class='flex align-center flex' :key="key0"
                  @tap="$refs.showSelectPopup1724747835146.tapHandle(key0)">
                  <image class='review_fd2_0_c1_c0_c0_c0' mode="aspectFill" :src='STATIC_URL+"guofang/46.png"'></image>
                  <text class='review_fd2_0_c1_c0_c0_c1'>{{item.name}}</text>
                </view>
                <view v-else class='flex align-center flex' :key="key0"
                  @tap="$refs.showSelectPopup1724747835146.tapHandle(key0)">
                  <image class='review_fd2_0_c1_c0_c0_c0' mode="aspectFill" :src='STATIC_URL+"guofang/47.png"'></image>
                  <text class='review_fd2_0_c1_c0_c0_c1'>{{item.name}}</text>
                </view>
              </template></benben-select-diy>
          </view>
        </view>
      </view>

      <!---flex布局flex布局结束-->
      <benben-popup v-model="popupShow1725071718913" :mask="true" :mask-close-able="true" mode='center'
        :z-index='999999'>
        <!---flex布局flex布局开始-->
        <view class="flex benben-flex-layout flex-wrap align-center">
          <view class='flex flex-direction flex-wrap align-stretch justify-between review_fd3_0'>
            <view class='flex flex-direction flex-wrap align-center justify-around review_fd3_0_c0'>
              <text class='review_fd3_0_c0_c0'>提示</text>
              <text class='review_fd3_0_c0_c1'>是否开始做题？</text>
            </view>
            <view class='flex flex-wrap align-center justify-center review_fd3_0_c1'>
              <view class='flex flex-wrap align-center justify-center review_fd3_0_c1_c0'>
                <text class='review_fd3_0_c1_c0_c0' @tap.stop="popupShow1725071718913=false">取消</text>
              </view>
              <view class='flex flex-wrap align-center justify-center review_fd3_0_c1_c1' @tap.stop="navs()">
                <text class='review_fd3_0_c1_c1_c0'>确定</text>
              </view>
            </view>
          </view>
        </view>

        <!---flex布局flex布局结束-->

      </benben-popup>


    </view>
  </page-body>
</template>
<script>
  export default {
    components: {},


    data() {
      return {
        list: "",
        "popupShow1725071718913": false,
        "deletes": [{
          "name": "答对一次移除",
          "value": "1",
          "image": ""
        }, {
          "name": "答对三次移除",
          "value": "2",
          "image": ""
        }],
        "deletVeal": "1",
        "deleteLab": "",
        "Onswitch": false,
        today: null,
        "navType": ""
      };
    },
    computed: {

    },
    watch: {
      // Onswitch(newVal) {
      //   console.log("newVal=>", newVal)
      //   // console.log("oldVal=>",oldVal)
      //   if (newVal == true) {
      //     this.setpost66d164d948d5b()
      //   }
      // }
    },
    onLoad(options) {
      let {
        navType
      } = options
      if (navType != undefined) this.navType = navType
    },
    onUnload() {

    },
    onReady() {

    },
    onShow() {
      this.getpost66d1643ddb79e()
      this.setpost66d164d948d5b()
    },
    onHide() {

    },
    onResize() {

    },
    onPullDownRefresh() {

    },
    onReachBottom(e) {

    },
    onPageScroll(e) {

    },
    methods: {
      async setpost66d1657cc97a9() {
        let datapost66d1657cc97a9 = await this.$api.post(global.apiUrls.post66d1657cc97a9, );
        if (datapost66d1657cc97a9.data.code != 1) {
          this.$message.info(datapost66d1657cc97a9.data.msg);
          return
        }
        let info66d1643ddb79e = datapost66d1657cc97a9.data;
        this.$message.success(datapost66d1657cc97a9.data.msg);
        this.getpost66d1643ddb79e()
        // this.$forceUpdate()
      },
      // changeStaed(0)
      // changeStae(){
      //   uni.
      // },
      changeStaed(val,num) {
        if(num==0){
          this.$message.info("暂无错题");
          return
        }
        this.popupShow1725071718913 = true
        this.today = val
      },
      navs() {
        uni.redirectTo({
          url: `/pages/examination/answer/answer?type=4&navType=${this.navType}&today=${this.today}`
        })
      },
      /* 设置移除错题次数 */
      async setpost66d164d948d5b() {
        let datapost66d164d948d5b = await this.$api.post(global.apiUrls.post66d1643ddb79e, {
          right: this.deletVeal
        });
        if (datapost66d164d948d5b.data.code != 1) {
          this.$message.info(datapost66d164d948d5b.data.msg);
          return
        }
      },
      TabsChange(val) {
        this.deletVeal = val.label
        this.setpost66d164d948d5b()
      },
      async getpost66d1643ddb79e() {
        let datapost66d1643ddb79e = await this.$api.post(global.apiUrls.post66d1643ddb79e);
        if (datapost66d1643ddb79e.data.code != 1) {
          this.$message.info(datapost66d1643ddb79e.data.msg);
          return
        }
        let info66d1643ddb79e = datapost66d1643ddb79e.data;

        console.log("datapost66d1643ddb79e=>", info66d1643ddb79e)
        this.list = info66d1643ddb79e.data

      }
    }
  };
</script>
<style lang="scss" scoped>
  .page {
    width: 100vw;
    overflow-x: hidden;
    min-height: calc(100vh - var(--window-bottom));
    background: #F6f6f6;
    background-size: 100% auto;
  }

  .review_flex_0 {
    background: url(image-path('45.png')) no-repeat;
    background-size: 100% auto;
    height: 522rpx;
    width: 100%;
    padding: 66rpx 32rpx 0rpx 32rpx;
    position: relative;
    margin: 0rpx 0rpx 0rpx 0rpx;
  }

  .review_fd0_0_c0_c0 {
    font-size: 36rpx;
  }

  .review_fd0_0 {
    width: 100%;
    margin: 21rpx 0rpx 0rpx 0rpx;
    height: 50rpx;
  }

  .review_flex_1 {
    padding: 0rpx 24rpx 0rpx 24rpx;
  }

  .review_fd1_0_c2_c0_c1 {
    font-size: 24rpx;
    font-weight: 500;
    color: rgba(51, 51, 51, 1);
    margin: 0rpx 0rpx 0rpx 010rpx;
  }

  .review_fd1_0_c0_c1 {
    color: rgba(153, 153, 153, 1);
    font-size: 24rpx;
    line-height: 33rpx;
    margin: 8rpx 0rpx 0rpx 0rpx;
  }

  .review_fd1_0_c0_c0 {
    text-align: center;
    font-size: 40rpx;
    line-height: 48rpx;
    font-weight: 500;
    margin: 0rpx 0rpx 8rpx 0rpx;
    color: rgba(51, 51, 51, 1);
  }

  .review_fd1_0 {
    background: rgba(255, 255, 255, 1);
    height: 258rpx;
    border-radius: 32rpx;
    margin: -100rpx 0rpx 0rpx 0rpx;
    background-size: 100% auto;
    padding: 0rpx 40rpx 0rpx 40rpx;
    position: relative;
  }

  .review_flex_2 {
    padding: 24rpx;
  }

  .review_fd2_0_c1_c0_c0_c1 {
    margin: 0rpx 0rpx 0rpx 16rpx;
  }

  .review_fd2_0_c1_c0_c0_c0 {
    width: 32rpx;
    height: 32rpx;
    border-radius: 0rpx 0rpx 0rpx 0rpx;
  }

  ::v-deep .review_fd2_0_c1_c0 {
    width: 100%;
  }

  .review_fd2_0_c0 {
    margin: 0rpx 0rpx 32rpx 0rpx;
  }

  .review_fd2_0 {
    background: rgba(255, 255, 255, 1);
    width: 100%;
    height: 176rpx;
    border-radius: 32rpx;
    background-size: 100% auto;
    padding: 32rpx;
  }

  .review_fd3_0_c1_c1_c0 {
    color: rgba(51, 51, 51, 1);
    font-size: 32rpx;
    line-height: 45rpx;
    font-weight: 500;
  }

  .review_fd3_0_c1_c1 {
    width: 259rpx;
    height: 98rpx;
  }

  .review_fd3_0_c1_c0_c0 {
    font-size: 32rpx;
    line-height: 44rpx;
    color: rgba(153, 153, 153, 1);
  }

  .review_fd3_0_c1_c0 {
    border-right: 1px solid #eee;
    width: 259rpx;
    height: 98rpx;
  }

  .review_fd3_0_c1 {
    height: 99rpx;
  }

  .review_fd3_0_c0_c1 {
    margin: 0rpx 0rpx 030rpx 0rpx;
    font-size: 36rpx;
    color: #333;
    line-height: 50rpx;
    font-weight: 500;
  }

  .review_fd3_0_c0_c0 {
    font-size: 32rpx;
    line-height: 44rpx;
    color: rgba(153, 153, 153, 1);
    font-weight: 800;
  }

  .review_fd3_0_c0 {
    border-bottom: 1px solid #eee;
    height: 227rpx;
  }

  .review_fd3_0 {
    background: rgba(255, 255, 255, 1);
    border-radius: 25rpx;
    width: 540rpx;
    height: 332rpx;
    background-size: 100% auto;
  }
</style>
